class Admin::SiteConfigurationsController < AdminController
  
  
  def index
    @site_configurations = SiteConfiguration.all
  end
  
  def new
    @site_configuration = SiteConfiguration.new
  end
  
  def create
    @site_configuration = SiteConfiguration.new(params[:site_configuration])
    if @site_configuration.save
      flash_notice(:site_configuration_created)
      
      redirect_to admin_site_configurations_url
    else 
      render :new
    end   
  end
  
  def destroy
    @site_configuration = SiteConfiguration.find(params[:id])
    @site_configuration.destroy
    flash_notice(:site_configuration_removed)
    respond_to do |format|
      format.html { redirect_to(admin_site_configurations_url) }
      format.xml  { head :ok }
    end
  end
  
  
  def edit
    @site_configuration = SiteConfiguration.find(params[:id])
  end
  
  def update
    @site_configuration = SiteConfiguration.find(params[:id])
    respond_to do |format|
      if @site_configuration.update_attributes(params[:site_configuration])
        flash_notice(:site_configuration_updated)
        format.html { redirect_to admin_site_configurations_url }
        format.xml  { head :ok }
      else
        flash_error(:site_configuration_not_updated)
        format.html { render :action => "edit" }
        format.xml  { render :xml => @site_configuration.errors, :status => :unprocessable_entity }
      end
    end
    
  end
  
end
